# coding: utf-8

# 常数类,包含游戏全部常数设定

# 程序界面大小
win_size = (600, 800) # 宽和高
# 主界面图像
bgImg = 'data/bgImg.jpg'
# 地图背景
map_bgImg = 'data/map_img.png'
# 地图大小:20行10列
rows = 20
columns = 10
# 地图区域位置
map_x = 149
map_y = 9
# 方块大小
act_size = 29 # 宽和高

# 方块默认位置
# 地图区域有 1px 的白边
act_x = map_x + columns*act_size//2 + 1
act_y = map_y + (rows-2)*act_size + 1
# 方块最初位置
block_init_position = (act_x, act_y)
# 方块下降速度
block_speed = -29
# 下一个方块显示位置
next_block_x = 150
next_block_y = 600
# 分数显示信息
score_x = 400
score_y = 700
score_color = (255,255,255,255)

# 背景音乐路径
bg_music = 'data/music/bg_music.mp3'
# 消除音效
elimiate_music = 'data/music/elimination_effect_music.wav'

# 背景音乐
bg_music = 'data/bg_music.mp3'
# 消除音效
eliminate_music = 'data/eliminate_music.mp3'


# 方块类型
shapes = {
    # L形
    'L' :
    [
        [0,0,0,0],    # i=0
        [0,0,0,0],    # i=1
        [0,0,1,0],    # i=2
        [1,1,1,0],    # i=3
    ],\
    # I形
    'I':
    [
        [0,0,0,0],
        [1,1,1,1],
        [0,0,0,0],
        [0,0,0,0],
    ],\
    # 反L形
    'L_':
    [
        [0,0,0,0],
        [0,0,0,0],
        [1,0,0,0],
        [1,1,1,0],
    ],\
    # Z形
    'Z':
    [
        [0,0,0,0],
        [0,0,0,0],
        [1,1,0,0],
        [0,1,1,0],
    ],\
    # 反Z形
    'Z_':
    [
        [0,0,0,0],
        [0,0,0,0],
        [0,1,1,0],
        [1,1,0,0],
    ],\
    # 田形
    'O':
    [
        [0,0,0,0],
        [0,0,0,0],
        [0,1,1,0],
        [0,1,1,0],
    ],\
    # 山形
    'W':
    [
        [0,0,0,0],
        [0,0,0,0],
        [0,1,0,0],
        [1,1,1,0],
    ],\

}
# 方块对应字母
block_index = ['L', 'I', 'L_', 'Z', 'Z_', 'O', 'W']


# 方块颜色
colors = [

    'blue',
    'red',
    'cyan',
    'black',
    'green',
    'magenta',
    'orange',
    'pink',
    'violet',
    'yellow',

]

# 刷新频率
flash = {
    'level_1':1.0,
    'level_2':1.5,
    'level_3':2.0,
    'level_4':2.5,
    'level_5':3.0,
    'level_6':3.5,
    'level_7':4.0,
    'level_8':5.0,
    'level_9':6.0,
    'level_10':7.0,
    'level_high':10.0
}

level = ['level_1', 'level_2', 'level_3', 'level_4', 'level_5', 'level_6', 'level_7', 'level_8', 'level_9', 'level_10', 'level_high']